<?php echo $header; ?><?php echo $column_left; ?><?php echo $column_right; ?>
<div id="content"><?php echo $content_top; ?>
  <div class="breadcrumb">
    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
    <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
    <?php } ?>
  </div>
  <h1><?php echo $_['heading_title']; ?></h1>
  <table class="list">
    <thead>
      <tr>
        <td class="left" colspan="2"><?php echo $_['text_order_detail']; ?></td>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="left" style="width: 50%;"><?php if ($invoice_no) { ?>
          <b><?php echo $_['text_invoice_no']; ?></b> <?php echo $invoice_no; ?><br />
          <?php } ?>
          <b><?php echo $_['text_order_id']; ?></b> #<?php echo $order_id; ?><br />
          <b><?php echo $_['text_date_added']; ?></b> <?php echo $date_added; ?></td>
        <td class="left" style="width: 50%;"><?php if ($payment_method) { ?>
          <b><?php echo $_['text_payment_method']; ?></b> <?php echo $payment_method; ?><br />
          <?php } ?>
          <?php if ($shipping_method) { ?>
          <b><?php echo $_['text_shipping_method']; ?></b> <?php echo $shipping_method; ?>
          <?php } ?></td>
      </tr>
    </tbody>
  </table>
  <table class="list">
    <thead>
      <tr>
        <td class="left"><?php echo $_['text_payment_address']; ?></td>
        <?php if ($shipping_address) { ?>
        <td class="left"><?php echo $_['text_shipping_address']; ?></td>
        <?php } ?>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="left"><?php echo $payment_address; ?></td>
        <?php if ($shipping_address) { ?>
        <td class="left"><?php echo $shipping_address; ?></td>
        <?php } ?>
      </tr>
    </tbody>
  </table>
  <table class="list">
    <thead>
      <tr>
        <td class="left"><?php echo $_['column_name']; ?></td>
        <td class="left"><?php echo $_['column_model']; ?></td>
        <td class="right"><?php echo $_['column_quantity']; ?></td>
		<td class="right"><?php echo $_['column_shipped']; ?></td>
        <td class="right"><?php echo $_['column_price']; ?></td>
        <td class="right"><?php echo $_['column_total']; ?></td>
        <?php if ($products) { ?>
        <td style="width: 1px;"></td>
        <?php } ?>
      </tr>
    </thead>
    <tbody>
      <?php foreach ($products as $product) { ?>
      <tr>
        <td class="left"><a href="<?php echo $product['href']; ?>" target="_blank"><?php echo $product['name']; ?></a>
          <?php foreach ($product['option'] as $option) { ?>
          <br />
          &nbsp;<small> - <?php echo $option['name']; ?>: <?php echo $option['value']; ?></small>
          <?php } ?></td>
        <td class="left"><?php echo $product['model']; ?></td>
        <td class="right"><?php echo $product['quantity']; ?></td>
		<td class="right"><?php echo $product['shipped_qty']; ?></td>
        <td class="right"><?php echo $product['price']; ?></td>
        <td class="right"><?php echo $product['total']; ?></td>
        <td class="right"><a href="<?php echo $product['return']; ?>"><img src="themes/default/image/return.png" alt="<?php echo $_['button_return']; ?>" title="<?php echo $_['button_return']; ?>" /></a></td>
      </tr>
      <?php } ?>
      <?php foreach ($vouchers as $voucher) { ?>
      <tr>
        <td class="left"><?php echo $voucher['description']; ?></td>
        <td class="left"></td>
        <td class="right">1</td>
        <td class="right"><?php echo $voucher['amount']; ?></td>
        <td class="right"><?php echo $voucher['amount']; ?></td>
        <?php if ($products) { ?>
        <td></td>
        <?php } ?>
      </tr>
      <?php } ?>
    </tbody>
    <tfoot>
      <?php foreach ($totals as $total) { ?>
      <tr>
        <td colspan="4"></td>
        <td class="right"><b><?php echo $total['title']; ?>:</b></td>
        <td class="right"><?php echo $total['text']; ?></td>
        <?php if ($products) { ?>
        <td></td>
        <?php } ?>
      </tr>
      <?php } ?>
    </tfoot>
  </table>
  <?php if ($comment) { ?>
  <table class="list">
    <thead>
      <tr>
        <td class="left"><?php echo $_['text_comment']; ?></td>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="left"><?php echo $comment; ?></td>
      </tr>
    </tbody>
  </table>
  <?php } ?>
    <?php if ($shipping_histories) { ?>
		<table class="list">
			<thead>
				<tr>
					<td class="left" colspan="5"><?php echo $_['text_shipping_info']; ?></td>
				</tr>
			</thead>
			<tbody>
				<?php foreach ($shipping_histories as $his) { ?>
				<tr>
					<td class="left"><?php echo $his['ship_date']; ?></td>
					<td class="left">
						<?php foreach($his['products'] as $p) { ?>
							<p><small><?php echo $p['name']; ?></small><br>
							<?php echo $p['model']; ?> <small>Qty</small>: <span class="green"><?php echo $p['shipped_qty']; ?></span></p>
						<?php } ?>
					</td>
					<td class="left"><?php echo $his['ship_carrier']; ?></td>
					<td class="left">
						<?php if ($his['tracking_link']) { ?>
							<a href="<?php echo $his['tracking_link']?>" target="_blank"><?php echo $his['track_number']; ?></a>
							<?php } else { ?>
							<?php echo $his['track_number']; ?>
						<?php } ?>
					</td>
					<td class="left"><?php echo $his['remark']; ?></td>
				</tr>
				<?php } ?>
			</tbody>
		</table>
	<?php } ?>
	
  <?php if ($histories) { ?>
  <h2><?php echo $_['text_history']; ?></h2>
  <table class="list">
    <thead>
      <tr>
        <td class="left"><?php echo $_['column_date_added']; ?></td>
        <td class="left"><?php echo $_['column_status']; ?></td>
        <td class="left"><?php echo $_['column_comment']; ?></td>
      </tr>
    </thead>
    <tbody>
      <?php foreach ($histories as $history) { ?>
      <tr>
        <td class="left"><?php echo $history['date_added']; ?></td>
        <td class="left"><?php echo $history['status']; ?></td>
        <td class="left"><?php echo $history['comment']; ?></td>
      </tr>
      <?php } ?>
    </tbody>
  </table>
  <?php } ?>
  <div class="buttons">
    <div class="right"><a href="<?php echo $continue; ?>" class="button"><?php echo $_['button_continue']; ?></a></div>
  </div>
  <?php echo $content_bottom; ?></div>
<?php echo $footer; ?> 